Advanced Unity Game Development by Victor G Brusca

Advanced Unity Game Development by Victor G Brusca

Author:Victor G Brusca
Language: eng
Format: epub
ISBN: 9781484278512
Publisher: Apress


01 void Update() {

02 if (!useFixedUpdate) {

03 UpdateFunction();

04 }

05 }

01 void OnControllerColliderHit(ControllerColliderHit hit) {

02 if (BaseScript.IsActive(scriptName) == false) {

03 return;

04 }

05

06 if (hit.normal.y > 0 && hit.normal.y > groundNormal.y && hit.moveDirection.y < 0) {

07 if ((hit.point - movement.lastHitPoint).sqrMagnitude > 0.001 || lastGroundNormal == Vector3.zero) {

08 groundNormal = hit.normal;

09 } else {

10 groundNormal = lastGroundNormal;

11 }

12

13 movement.hitPoint = hit.point;

14 movement.frameVelocity = Vector3.zero;

15 }

16 }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.